package jf.jextn.converter;

public class NullConverter<V> implements Converter<V, V>, IsNullSafe {

    private static NullConverter<?> INSTANCE = new NullConverter<>();

    public NullConverter() {
    }

    @Override
    public V from(V value) {
        return value;
    }

    @Override
    public V to(V o) {
        return o;
    }

    @SuppressWarnings("unchecked")
    public static <V> NullConverter<V> instance() {
        return (NullConverter<V>) INSTANCE;
    }

}
